package com.mixes;

import static com.mixes.util.Utility.*;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.Menu;
import android.view.MenuItem;

import com.mixes.adapter.MainPagerAdapter;
import com.mixes.key.KeyManager;
import com.mixes.view.SendDialog;

public class MainActivity extends BaseFragmentActivity {
    private ViewPager mViewPager;

    private MainPagerAdapter mMainPagerAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        showDebugToast(String.format(getString(R.string.development_message), KeyManager.MODE_TYPE));

        mMainPagerAdapter = new MainPagerAdapter(this);
        mViewPager = customFindViewById(this, R.id.view_pager);
        mViewPager.setId(582); // FIXME
        mViewPager.setAdapter(mMainPagerAdapter);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.menu_search:
            break;
        case R.id.menu_send:
            showSendDialog();
            break;
        case R.id.menu_twitter:
            break;
        case R.id.menu_facebook:
            break;
        case R.id.menu_googleplus:
            break;
        case R.id.menu_mixi:
            break;
        }

        return super.onOptionsItemSelected(item);
    }

    private void showSendDialog() {
        SendDialog sendDialog = new SendDialog(this);
        sendDialog.show();
    }
}
